
#ifndef SHAPEPANEL_H
#define SHAPEPANEL_H

#include <BShape>
#include <BElement>

#include <BSpinBox>
#include <BRealSpinBox>
#include <BFloatSpinBox>
#include <BGroupBox>
#include <BButton>
#include <BColorDialog>
#include <BLabel>
#include <BLineEdit>
#include <BButton>
#include <BCheckBox>
#include <BComboBox>
#include <BGroupBox>

using namespace BWE;

class ShapePanel : public BGroupBox
{
	BOBJECT(ShapePanel)
public:
	ShapePanel(BWidget* parent = 0);
	~ShapePanel();

protected:
	void slotAssetChanged(BObject* object, const BValue& value);
	void slotFoldeButtonChecked(BObject* object, const BValue& value);

	void slotIsolateCheckBoxToggled(BObject* object, const BValue& value);
	void slotVisibleCheckBoxToggled(BObject* object, const BValue& value);
	void slotLineWidthEdited(BObject* object, const BValue& value);
	void slotPointSizeEdited(BObject* object, const BValue& value);
	void slotPolygonModeToggled(BObject* object, const BValue& value);
	void slotDepthOffsetEditFinished(BObject* object, const BValue& value);

	void slotShapeChanged(BShape* shape);
	void slotMaterialRenamed(BMaterial* material);
	void slotMaterialChanged(BMaterial* material);

	void slotLightingToggled(BObject* object, const BValue& value);
	void slotCullbackToggled(BObject* object, const BValue& value);
	void slotDepthTestToggled(BObject* object, const BValue& value);
	void slotPointSmoothToggled(BObject* object, const BValue& value);
	void slotLineSmoothToggled(BObject* object, const BValue& value);
	void slotPolygonSmoothToggled(BObject* object, const BValue& value);
	void slotTransparentToggled(BObject* object, const BValue& value);
	void slotNormalizeToggled(BObject* object, const BValue& value);

	void slotMaterialButtonClicked();
	void slotColorButtonClicked();

protected:
	virtual void styleEvent(const BEvent& event);
	virtual void paintEvent(const BEvent& event);

private:
	BButton*			_foldeButton;
	BCheckBox*			_isolateCheckBox;
	BCheckBox*			_visibleCheckBox;
	BFloatSpinBox*		_lineWidthSpinBox;
	BFloatSpinBox*		_pointSizeSpinBox;
	BComboBox*			_polyModeComboBox;

	BCheckBox*			_lightingCheckBox;
	BCheckBox*			_cullbackCheckBox;
	BCheckBox*			_depthTestCheckBox;
	BFloatSpinBox*		_depthOffsetSpinBox;
	BCheckBox*			_pointSmoothCheckBox;
	BCheckBox*			_lineSmoothCheckBox;
	BCheckBox*			_polySmoothCheckBox;
	BCheckBox*			_transparentCheckBox;
	BCheckBox*			_normalizeCheckBox;
	BButton*			_materialButton;
	BButton*			_colorButton;

	BHolder<BShape>			_shape;
	BHolder<BMaterial>		_material;
};

#endif